package com.icode.core.dto.user;

import com.icode.core.model.user.Member;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: xianfei
 * Date: 15-3-16
 * Time: 上午10:35
 * To change this template use File | Settings | File Templates.
 */
public class MemberDTO {

    private String id;
    private String guid;
    private String name;
    private String gender;
    private String idCard;
    private String phoneNum;
    private String telephone;
    private String birthday;
    private String age;
    private String idCardAddress;
    private String residentCity;
    private String initiateDate;
    private String initiateMoney;
    private String accountDetail;
    private String hobby;
    private String customService;
    private String entryPerson;


    public MemberDTO() {
    }

    public MemberDTO(String id, String guid, String name, String gender, String idCard, String phoneNum, String telephone, String birthday, String age, String idCardAddress, String residentCity, String initiateDate, String initiateMoney, String accountDetail, String hobby, String customService, String entryPerson) {
        this.id = id;
        this.guid = guid;
        this.name = name;
        this.gender = gender;
        this.idCard = idCard;
        this.phoneNum = phoneNum;
        this.telephone = telephone;
        this.birthday = birthday;
        this.age = age;
        this.idCardAddress = idCardAddress;
        this.residentCity = residentCity;
        this.initiateDate = initiateDate;
        this.initiateMoney = initiateMoney;
        this.accountDetail = accountDetail;
        this.hobby = hobby;
        this.customService = customService;
        this.entryPerson = entryPerson;
    }

    public static MemberDTO toDTO(Member member) {
        return new MemberDTO(member.id(), member.guid(), member.name(), member.gender(), member.idCard(), member.phoneNum(), member.telephone(), member.birthday(), member.age(), member.idCardAddress(), member.residentCity(), member.initiateDate(), member.initiateMoney(), member.accountDetail(), member.hobby(), member.customService(), member.entryPerson());
    }

    public static List<MemberDTO> toDTOs(List<Member> members) {
        List<MemberDTO> memberDTOs = new ArrayList<>();
        for (Member m : members) {
            MemberDTO memberDTO = toDTO(m);
            memberDTOs.add(memberDTO);
        }
        return memberDTOs;
    }

    public static Member toMember(MemberDTO memberDTO) {
        return new Member(memberDTO.getName(), memberDTO.getGender(), memberDTO.getIdCard(), memberDTO.getPhoneNum(), memberDTO.getTelephone(), memberDTO.getBirthday(), memberDTO.getAge(), memberDTO.getIdCardAddress(), memberDTO.getResidentCity(), memberDTO.getInitiateDate(), memberDTO.getInitiateMoney(), memberDTO.getAccountDetail(), memberDTO.getHobby(), memberDTO.getCustomService(), memberDTO.getEntryPerson());
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setGuid(String guid) {
        this.guid = guid;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public void setResidentCity(String residentCity) {
        this.residentCity = residentCity;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getTelephone() {

        return telephone;
    }

    public void setInitiateDate(String initiateDate) {
        this.initiateDate = initiateDate;
    }

    public void setInitiateMoney(String initiateMoney) {
        this.initiateMoney = initiateMoney;
    }

    public void setAccountDetail(String accountDetail) {
        this.accountDetail = accountDetail;
    }

    public void setHobby(String hobby) {
        this.hobby = hobby;
    }

    public void setCustomService(String customService) {
        this.customService = customService;
    }

    public void setEntryPerson(String entryPerson) {
        this.entryPerson = entryPerson;
    }

    public String getBirthday() {

        return birthday;
    }

    public String getAge() {
        return age;
    }

    public String getResidentCity() {
        return residentCity;
    }

    public String getInitiateDate() {
        return initiateDate;
    }

    public String getInitiateMoney() {
        return initiateMoney;
    }

    public String getAccountDetail() {
        return accountDetail;
    }

    public String getHobby() {
        return hobby;
    }

    public String getCustomService() {
        return customService;
    }

    public String getEntryPerson() {
        return entryPerson;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public void setPhoneNum(String phoneNum) {
        this.phoneNum = phoneNum;
    }

    public void setIdCardAddress(String idCardAddress) {
        this.idCardAddress = idCardAddress;
    }

    public String getId() {

        return id;
    }

    public String getGuid() {
        return guid;
    }

    public String getName() {
        return name;
    }

    public String getGender() {
        return gender;
    }

    public String getIdCard() {
        return idCard;
    }

    public String getPhoneNum() {
        return phoneNum;
    }

    public String getIdCardAddress() {
        return idCardAddress;
    }
}
